﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:local="clr-namespace:UColor.WPF"
	xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"                
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!--BEGIN WPF-->
	<Style x:Key="ButtonFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle SnapsToDevicePixels="true" Margin="3" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="ButtonNormalBackgroundFill" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FFFFFFFF" Offset="0" />
		<GradientStop Color="#FFF0F0EA" Offset="0.9" />
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ButtonBorder" Color="#FF003C74" />

	<Style x:Key="ExpanderHeaderFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Border>
						<Rectangle SnapsToDevicePixels="true" Margin="0" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="White" Offset="0" />
		<GradientStop Color="#FFBFBFBF" Offset="0.5" />
		<GradientStop Color="#FF878787" Offset="1" />
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#FFF0F8FE" Offset="0" />
		<GradientStop Color="#FFE0F3FE" Offset="0.3" />
		<GradientStop Color="#FF6FA7C5" Offset="1" />
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0,1" StartPoint="0,0">
		<GradientStop Color="#FFDCF0FA" Offset="0" />
		<GradientStop Color="#FFC5E6F7" Offset="0.2" />
		<GradientStop Color="#FF5690D0" Offset="1" />
	</LinearGradientBrush>
    <!--END WPF-->
    <Style TargetType="local:DemoExpander">
        <!--BEGIN WPF-->
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <!--END WPF-->
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DemoExpander">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <dxc:DXDockPanel>
                            <ToggleButton x:Name="HeaderSite" HorizontalContentAlignment="Center" Content="{TemplateBinding Header}" Margin="0,1,1,3" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" dxc:DXDockPanel.Dock="Top" />
                            <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <ContentPresenter.Visibility>
                                    <Binding Path="IsExpanded" RelativeSource="{RelativeSource TemplatedParent}" Mode="TwoWay">
                                        <Binding.Converter>
                                            <dxc:BoolToVisibilityConverter />
                                        </Binding.Converter>
                                    </Binding>
                                </ContentPresenter.Visibility>
                            </ContentPresenter>
                        </dxc:DXDockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ExpandDirection" Value="Right">
                            <Setter Property="dxc:DXDockPanel.Dock" TargetName="ExpandSite" Value="Right" />
                            <Setter Property="dxc:DXDockPanel.Dock" TargetName="HeaderSite" Value="Left" />
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Up">
                            <Setter Property="dxc:DXDockPanel.Dock" TargetName="ExpandSite" Value="Top" />
                            <Setter Property="dxc:DXDockPanel.Dock" TargetName="HeaderSite" Value="Bottom" />
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Left">
                            <Setter Property="dxc:DXDockPanel.Dock" TargetName="ExpandSite" Value="Left" />
                            <Setter Property="dxc:DXDockPanel.Dock" TargetName="HeaderSite" Value="Right" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>